package net.piencak.phonetools.eurocoins;

import java.io.IOException;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.ImageItem;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.StringItem;

public class AboutForm extends Form {

	private EuroCoinCollector app;
	
	public AboutForm(EuroCoinCollector app) {
		super("Zbierka euro mincí");
		
		this.app = app;
		
		appendStringItem("Zbierka euro mincí", " v Mobile");
		appendStringItem("Verzia : ", app.getAppProperty("MIDlet-Version"));
		appendStringItemLink("Autor programu : ", "phonetools@piencak.net");
		appendStringItemLink("", "www.piencak.net/phonetools");
		appendStringItemLink("Obrázky mincí sú od ", "E.C.B.");
		
		addCommand(app.exit);
		addCommand(app.coll);
		
		setCommandListener(app);
	}
	
	private void appendStringItem(String label, String text) {
		StringItem stringItem = new StringItem(label, text);
		stringItem.setLayout(Item.LAYOUT_NEWLINE_AFTER);
		append(stringItem);		
	}

	private void appendStringItemLink(String label, String text) {
		StringItem stringItem = new StringItem(label, text, StringItem.HYPERLINK);
		stringItem.setLayout(Item.LAYOUT_NEWLINE_AFTER);
		append(stringItem);		
	}
	
}
